package swing.java2d;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;

import javax.swing.JFrame;

public class Test1 extends JFrame {
	
	public Test1(){
		super();
		this.setTitle("2d测试");
		this.setSize(500,300);
		this.setVisible(true);
		
	}
	
	@Override
	public void paint(Graphics g) {
		 this.setBackground(Color.LIGHT_GRAY);
		 g.setColor(Color.red);
		 Font font=new Font("Serif", Font.BOLD, 30);
		 g.setFont(font);
 	 
		 g.drawString("JAVA Programming", 100, 100);
		 
	}

	public static void main(String[] args) {
		
		Test1 win= new Test1();
		win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
	}

}
